<template>
	<view>
		<pageIndex :myInfo="showList" :banner="require('@/static/image/mission/banner.png')" :img="img"></pageIndex>
	</view>
</template>

<script>
	import {
		navList
	} from '@/mock/index/mission.js';
	import pageIndex from '../../components/pageIndex.vue';
	import {
		Index
	} from '@/api/index.js';
	import {
		mapState
	} from 'vuex';
	export default {
		components: {
			pageIndex
		},
		data() {
			return {
				navList,
				img: '',
				showList: [],
			};
		},
		computed: {
			...mapState(['userInfo'])
		},
		methods: {
			async init() {
				const res = await Index.getCover('精准宣教')
				if (res.data.list.length) {
					this.img = res.data.list[0].img_src
				}
				console.log('ses')
			}
		},
		async onLoad() {
			await this.init()
			if (this.userInfo.user_role == 'normal') {
				this.showList = this.navList.filter(item => {
					return item.title !== "活动资料审核"
				})
			} else if (this.userInfo.user_role == 'leader') {
				this.showList = this.navList.filter(item => {
					return item.title !== "活动资料上报"
				})
			} else if (this.userInfo.user_role == 'boss') {
				this.showList = this.navList.filter(item => {
					return item.title !== "活动资料上报"
				})
			}
			console.log(this.showList)
		}
	}
</script>

<style lang="scss">

</style>
